//必输项显示小红星
//$(document).ready(function(){
//			$("#questiontitle,#questiondescribe").UITipInside( {
//				'required' : true,
//				'cleaner' : false
//			});
//		});
		
// 变量， 当区域切换的时候 设置下，表明是区域切换 不用校验 总价报价单元等其他，只校验明细报价	
var is_quote_price=false;
		
		
//打开澄清答疑页面信息
function openReleaseqa(pk_group,pk_org,pk_pur_project){
//	var pkProj = document.getElementById("pk_pur_project").value;
	var pk_purproj_step = document.getElementById("pk_purproj_step").value;
	var pk_release_h = document.getElementById("pk_release_h").value;
	var type = document.getElementById("type").value;
	window.open(ebvpContext+"/sourcing/biddingprojlist/releaseqaInfo?pk_release_h="+pk_release_h+"&pk_purproj_step="+pk_purproj_step+"&pk_group="+encodeURI(pk_group)+"&pk_org="+encodeURI(pk_org)+"&pk_pur_project="+pk_pur_project+"&type="+type);
}

$(function() {
    $( ".idBidProductDetail" ).live('click', function() {
        var detailModuls = $( this ).parent().next(".bid_detail_modules");
        if(detailModuls.is(":hidden")) {
            detailModuls.slideDown();
            $( this ).addClass("up");
        } else {
            detailModuls.slideUp();
            $( this ).removeClass("up");
        }
        return false;
    });
});


//提交响应信息
function doReply(){
	
	if(is_start_price=='false'){
	
		showMsg("该环节还没开始投标！");
		return;
	}
 
	if(toAccountSecond <= 0){
		showMsg(getLanMsg("0ec22211-000057"));
		return;
	}
	if(isDelayCanReply != "true" && isHandlePass == 1){
		showMsg(getLanMsg("0ec22211-000076"));
		return;
	}

	if(checkInput()){
		//签名
		var bResult = true;
		if (isClientCa == "true") {
			bResult = doVerifyPriceData();
		}

		//提交表单
		if(bResult){
			document.replyform.action = ebvpContext+"/sourcing/biddingprojlist/purfilereply?type="+type+"&xmb="+xmb;//项目部，蜀电
			document.replyform.submit();
		}
	}
}
//蜀电
function ht_xmb(){
	xmb=document.getElementById("xmb").value; 
}

//上传文件
function uploadFile(pk_release_file_b){
/**	try{
		if (isClientCa == "true") {
			var strSn = getSN(strUserCode);
			var strcert = getcert(strUserCode);
			if(strSn == null || strSn == ""){
				showMsg(getLanMsg("0ec22211-000058"));
				return;
			}else{
				if(strcert == null || strcert == ""){
					alert("证书获取失败");
					return;
				}else{
				
					var signstr = signmessage(strUserCode,strcert);
					if(signstr == null || signstr == "" || typeof(signstr) == "number"){
						alert("签名失败");
						return;
							}
					
				}
			}
		}
	}catch(e){
		alert("签名失败");
		return;
	}
	**/
		if (isClientCa == "true") {
		var strSn = getSN(strUserCode);
		if(strSn == null || strSn == ""){
			showMsg(getLanMsg("0ec22211-000058"));
			return;
		}
	}
	var url = ebvpContext+"/sourcingcoll/FileUpload_new.jsp";
	url = url + "?" + "uploadMode=" + type;
	url = url + "&" + "userCode="+strUserCode;
	url = url + "&" + "pkReleaseFileB="+pk_release_file_b;
	url = url + "&" + "isNeedAddRow=Y";
	var iTop = (window.screen.availHeight-30-330)/2;
	var iLeft = (window.screen.availWidth-10-620)/2;
	window.open(url,'' ,'width=620,height=330,location=no'+',top='+iTop+',left='+iLeft);
}

var editRow = 0;
function doCalPrice(index){
	
	//计算行号
	editRow = 0;
	var rowId = document.getElementsByName("row_id");
	for(var i=0;i<rowId.length;i++){
		if(rowId[i].value == index){
			editRow = i;
			break;
		}
	}
	//物料主健
	var prodPks = document.getElementsByName("pk_prod_v");
	if(prodPks.length > editRow){
		document.calpriceform.pk_prod_cal.value = prodPks[editRow].value;
	}
	//报价单位
	var prodUnitPks = document.getElementsByName("pk_prod_unit");
	if(prodUnitPks.length > editRow){
		document.calpriceform.pk_unit_cal.value = prodUnitPks[editRow].value;
	}
	//数量
	var amounts = document.getElementsByName("amount");  
	//增加配置单 现在数量可能为空了
	
	document.calpriceform.amount_cal.value = amounts[editRow]==null?0:amounts[editRow].value;
	
	
	//含税单价
	var hasTaxPrices = document.getElementsByName("has_tax_price");
	
	if(hasTaxPrices != null &&hasTaxPrices != "" &&hasTaxPrices[editRow]!=null&&hasTaxPrices[editRow].value != null){
		if(hasTaxPrices[editRow].value == "" || hasTaxPrices[editRow].value == null){
		hasTaxPrices[editRow].value == "0.00";
	}
	document.calpriceform.has_tax_price_cal.value = hasTaxPrices[editRow].value;
	
	}
	
	
	
	//基价
	var baseprices = document.getElementsByName("base_price");
	
	if(baseprices != null &&baseprices != "" &&baseprices[editRow]!=null&&baseprices[editRow].value != null){
		document.calpriceform.base_price.value = baseprices[editRow].value;
	}
	
	
	
	//多价格项
	var price_item1s = document.getElementsByName("price_item1");
	
	if(price_item1s != null &&price_item1s != "" &&price_item1s[editRow]!=null&& price_item1s[editRow].value != null){
		document.calpriceform.price_item1.value = price_item1s[editRow].value;
	}
	
	
		//多价格项
	var price_item2s = document.getElementsByName("price_item2");
	
	if(price_item2s != null &&price_item2s != "" &&price_item2s[editRow]!=null&& price_item2s[editRow].value != null){
		document.calpriceform.price_item2.value = price_item2s[editRow].value;
	}
	
	
	var price_item3s = document.getElementsByName("price_item3");
	
	if(price_item3s != null &&price_item3s != "" &&price_item3s[editRow]!=null&& price_item3s[editRow].value != null){
		document.calpriceform.price_item3.value = price_item3s[editRow].value;
	}
	
	
	var price_item4s = document.getElementsByName("price_item4");
	
	if(price_item4s != null &&price_item4s != "" &&price_item4s[editRow]!=null&& price_item4s[editRow].value != null){
		document.calpriceform.price_item4.value = price_item4s[editRow].value;
	}
	var price_item5s = document.getElementsByName("price_item5");
	
	if(price_item5s != null &&price_item5s != "" &&price_item5s[editRow]!=null&& price_item5s[editRow].value != null){
		document.calpriceform.price_item5.value = price_item5s[editRow].value;
	}
	
	var price_item6s = document.getElementsByName("price_item6");
	
	if(price_item6s != null &&price_item6s != "" &&price_item6s[editRow]!=null&& price_item6s[editRow].value != null){
		document.calpriceform.price_item6.value = price_item6s[editRow].value;
	}
	
	var price_item7s = document.getElementsByName("price_item7");
	
	if(price_item7s != null &&price_item7s != "" &&price_item7s[editRow]!=null&& price_item7s[editRow].value != null){
		document.calpriceform.price_item7.value = price_item7s[editRow].value;
	}
	
	var price_item8s = document.getElementsByName("price_item8");
	
	if(price_item8s != null &&price_item3s != "" &&price_item8s[editRow]!=null&& price_item8s[editRow].value != null){
		document.calpriceform.price_item8.value = price_item8s[editRow].value;
	}
	
	var price_item9s = document.getElementsByName("price_item9");
	
	if(price_item9s != null &&price_item9s != "" &&price_item9s[editRow]!=null&& price_item9s[editRow].value != null){
		document.calpriceform.price_item9.value = price_item9s[editRow].value;
	}
	
	var price_item10s = document.getElementsByName("price_item10");
	
	if(price_item10s != null &&price_item10s != "" &&price_item10s[editRow]!=null&& price_item10s[editRow].value != null){
		document.calpriceform.price_item10.value = price_item10s[editRow].value;
	}
	
	var price_item11s = document.getElementsByName("price_item11");
	
	if(price_item11s != null &&price_item11s != "" &&price_item11s[editRow]!=null&& price_item11s[editRow].value != null){
		document.calpriceform.price_item11.value = price_item11s[editRow].value;
	}
	var price_item12s = document.getElementsByName("price_item12");
	
	if(price_item12s != null &&price_item12s != "" &&price_item12s[editRow]!=null&& price_item12s[editRow].value != null){
		document.calpriceform.price_item12.value = price_item12s[editRow].value;
	}
	
	var price_item13s = document.getElementsByName("price_item13");
	
	if(price_item13s != null &&price_item13s != "" &&price_item13s[editRow]!=null&& price_item13s[editRow].value != null){
		document.calpriceform.price_item13.value = price_item13s[editRow].value;
	}
	
	var price_item14s = document.getElementsByName("price_item14");
	
	if(price_item14s != null &&price_item14s != "" &&price_item14s[editRow]!=null&& price_item14s[editRow].value != null){
		document.calpriceform.price_item14.value = price_item14s[editRow].value;
	}
	
	
	var price_item15s = document.getElementsByName("price_item15");
	
	if(price_item15s != null &&price_item15s != "" &&price_item15s[editRow]!=null&& price_item15s[editRow].value != null){
		document.calpriceform.price_item15.value = price_item15s[editRow].value;
	}
	
		var price_item16s = document.getElementsByName("price_item16");
	
	if(price_item16s != null &&price_item16s != "" &&price_item16s[editRow]!=null&& price_item16s[editRow].value != null){
		document.calpriceform.price_item16.value = price_item16s[editRow].value;
	}
	
		var price_item17s = document.getElementsByName("price_item17");
	
	if(price_item17s != null &&price_item17s != "" &&price_item17s[editRow]!=null&& price_item17s[editRow].value != null){
		document.calpriceform.price_item17.value = price_item17s[editRow].value;
	}
	
		var price_item18s = document.getElementsByName("price_item18");
	
	if(price_item18s != null &&price_item18s != "" &&price_item18s[editRow]!=null&& price_item18s[editRow].value != null){
		document.calpriceform.price_item18.value = price_item18s[editRow].value;
	}
	
		var price_item19s = document.getElementsByName("price_item19");
	
	if(price_item19s != null &&price_item19s != "" &&price_item19s[editRow]!=null&& price_item19s[editRow].value != null){
		document.calpriceform.price_item19.value = price_item19s[editRow].value;
	}
	
	
	var price_item20s = document.getElementsByName("price_item20");
	
	if(price_item20s != null &&price_item20s != "" &&price_item20s[editRow]!=null&& price_item20s[editRow].value != null){
		document.calpriceform.price_item20.value = price_item20s[editRow].value;
	}
	
	var price_item21s = document.getElementsByName("price_item21");
	
	if(price_item21s != null &&price_item21s != "" &&price_item21s[editRow]!=null&& price_item21s[editRow].value != null){
		document.calpriceform.price_item21.value = price_item21s[editRow].value;
	}
	var price_item22s = document.getElementsByName("price_item22");
	
	if(price_item22s != null &&price_item22s != "" &&price_item22s[editRow]!=null&& price_item22s[editRow].value != null){
		document.calpriceform.price_item22.value = price_item22s[editRow].value;
	}
	
	var price_item23s = document.getElementsByName("price_item23");
	
	if(price_item23s != null &&price_item23s != "" &&price_item23s[editRow]!=null&& price_item23s[editRow].value != null){
		document.calpriceform.price_item23.value = price_item23s[editRow].value;
	}
	
	var price_item24s = document.getElementsByName("price_item24");
	
	if(price_item24s != null &&price_item24s != "" &&price_item24s[editRow]!=null&& price_item24s[editRow].value != null){
		document.calpriceform.price_item24.value = price_item24s[editRow].value;
	}
	
	var price_item25s = document.getElementsByName("price_item25");
		if(price_item25s != null &&price_item25s != "" &&price_item25s[editRow]!=null&& price_item25s[editRow].value != null){
		document.calpriceform.price_item25.value = price_item25s[editRow].value;
	}
	
		var price_item26s = document.getElementsByName("price_item26");
	
	if(price_item26s != null &&price_item26s != "" &&price_item26s[editRow]!=null&& price_item26s[editRow].value != null){
		document.calpriceform.price_item26.value = price_item26s[editRow].value;
	}
	
		var price_item27s = document.getElementsByName("price_item27");
	
	if(price_item27s != null &&price_item27s != "" &&price_item27s[editRow]!=null&& price_item27s[editRow].value != null){
		document.calpriceform.price_item27.value = price_item27s[editRow].value;
	}
	
		var price_item28s = document.getElementsByName("price_item28");
	
	if(price_item28s != null &&price_item28s != "" &&price_item28s[editRow]!=null&& price_item28s[editRow].value != null){
		document.calpriceform.price_item28.value = price_item28s[editRow].value;
	}
	
		var price_item29s = document.getElementsByName("price_item29");
	
	if(price_item29s != null &&price_item29s != "" &&price_item29s[editRow]!=null&& price_item29s[editRow].value != null){
		document.calpriceform.price_item29.value = price_item29s[editRow].value;
	}
	var price_item30s = document.getElementsByName("price_item30");
	if(price_item30s != null &&price_item30s != "" &&price_item30s[editRow]!=null&& price_item30s[editRow].value != null){
		document.calpriceform.price_item30.value = price_item30s[editRow].value;
	}
	
	//innercode 分析套件 子件
	var innercode = document.getElementsByName("innercode");
	if(innercode != null &&innercode != "" &&innercode[editRow]!=null&& innercode[editRow].value != null){
		document.calpriceform.innercode_cal.value = innercode[editRow].value;
	}
	
	
	
	//税率
	var taxRates = document.getElementsByName("tax_rate");
	if(taxRates[editRow].value == "" || taxRates[editRow].value == null){
		taxRates[editRow].value = "0.00";
	}
	document.calpriceform.tax_rate_cal.value = taxRates[editRow].value;
	//折扣率
	var discountRates = document.getElementsByName("detail_discount");
	if(discountRates[editRow].value == "" || discountRates[editRow].value == null){
		return;
	}
	document.calpriceform.discount_rate_cal.value = discountRates[editRow].value;
	var formStr = $('#calpriceform').serialize();
	$.ajax( {
		url : ebvpContext+"/sourcing/biddingprojlist/calprice",
		type : "POST",
		data : "&" + formStr,
		dataType : "text",
		async : false,
		success : function(responseText) {
			showResponse(responseText);
		}
	});
}

function showResponse(responseText, statusText, xhr, $form) {
	//alert(responseText);
	// 0:报价数量|1:税率|2:折扣率|3:含税单价|4:价税合计（含税金额）|5:含税净价|6:主含税净价|7:无税单价|8:无税金额|9:无税净价|10:主无税净价|11:税e
	var responseArr = responseText.split("|");
	//数量
	var amounts = document.getElementsByName("amount");  
	//含税单价
	var hasTaxPrices = document.getElementsByName("has_tax_price");
	if(hasTaxPrices != null &&hasTaxPrices != "" &&hasTaxPrices[editRow]!=null&& hasTaxPrices[editRow].value != null){
		hasTaxPrices[editRow].value = subRedubqNum(responseArr[3],intPricePrecision);
	}
	
	//税率
	var taxRates = document.getElementsByName("tax_rate");
	
	if(taxRates != null &&taxRates != "" &&taxRates[editRow]!=null&& taxRates[editRow].value != null){
			taxRates[editRow].value = subRedubqNum(responseArr[1],2);
	}
	
	//折扣率
	var discountRates = document.getElementsByName("detail_discount");
	
	if(discountRates != null &&discountRates != "" &&discountRates[editRow]!=null&& discountRates[editRow].value != null){
		discountRates[editRow].value = subRedubqNum(responseArr[2],2);
	}
	
	
	//折后价（含税净价或者无税竞价，统一取含税净价）
	var hasTaxNetPrices = document.getElementsByName("discount_net_price");
	
	if(hasTaxNetPrices != null &&hasTaxNetPrices != "" &&hasTaxNetPrices[editRow]!=null&& hasTaxNetPrices[editRow].value != null){
		hasTaxNetPrices[editRow].value = subRedubqNum(responseArr[5],intPricePrecision);
	}
	
	//折后金额（价税合计）
	var priceTaxSums = document.getElementsByName("discount_net_sum");
	if(null != responseArr[4] && "null" != responseArr[4] && "undefined" != typeof responseArr[4]){
		priceTaxSums[editRow].value = subRedubqNum(responseArr[4],intMnyPrecision);
	}else{
		priceTaxSums[editRow].value = "";
	}
	//更新报价单元合计数据
	var isProdItem = document.getElementsByName("is_prod_item");
	var totalAmount = document.getElementsByName("total_amount");
	var prodTotalAmount = document.getElementsByName("prod_total_amount");
	var lastTotalAmount = document.getElementsByName("last_total_amount");
	
	var innercode_all = document.getElementsByName("innercode");
	
	var prodTotalAmountValue = null;
	var lastTotalAmountValue = 0;
		
	for(var i=0;i<isProdItem.length;i++){
		if(isProdItem[i].value == "Y"){
			totalAmount[i].value = "0.00";
			for(var j=0;j<priceTaxSums.length;j++){
			
				//是否是套件
				var is_main=true;
	
				//如果是子件的话就不算总计金额了
					if(innercode_all!=null&&innercode_all[j]!=null){
						if(innercode_all[j].value!=null&&innercode_all[j].value.length>4)
								is_main=false;
					}
				
				if(!is_main)
					continue;
				
				if(parseFloat(amounts[j].value) > 0){
					//数量不为空的情况，则累加金额
					if(priceTaxSums[j].value != "" && priceTaxSums[j].value != null && priceTaxSums[j].value != "null"){
						totalAmount[i].value = parseFloat(totalAmount[i].value) + parseFloat(priceTaxSums[j].value);
					}
				}else{
					//数量为空时，则累加折后含税单价
					if(hasTaxNetPrices[j].value != "" && hasTaxNetPrices[j].value != null && hasTaxNetPrices[j].value != "null"){
						totalAmount[i].value = parseFloat(totalAmount[i].value) + parseFloat(hasTaxNetPrices[j].value);
					}
				}
			}
			subReduNum(totalAmount[i],intMnyPrecision);
			prodTotalAmountValue = totalAmount[i].value;
		}
		if(totalAmount[i].value != "" && totalAmount[i].value != null && totalAmount[i].value != "null"){
			lastTotalAmountValue = lastTotalAmountValue + parseFloat(totalAmount[i].value);
		}
	}
	prodTotalAmount[0].value = prodTotalAmountValue;
	lastTotalAmount[0].value = lastTotalAmountValue;
	subReduNum(lastTotalAmount[0],intMnyPrecision);
}

function  checkQuotePriceInput(){

	//数量
	var amount = document.getElementsByName("amount");
	 
	//含税单价
	var hasTaxPrice = document.getElementsByName("has_tax_price");
	
	
	
	//折后单价
	var discount_net_price = document.getElementsByName("discount_net_price");
	 
	//税率
	var taxRate = document.getElementsByName("tax_rate");
	 
	//折扣率
	var detailDiscount = document.getElementsByName("detail_discount");
	 
	var discount_price_name=document.getElementById("discount_price_name");

	var bResult = true;
	var msg = "";
	var cellItems = new Array();
	cellItems[0] = amount;
	cellItems[1] = discount_net_price;
//	cellItems[2] = taxRate;
//	cellItems[3] = detailDiscount;
	var cellNames = new Array();
	cellNames[0] = getLanMsg("0ec22211-000023");
	if(discount_price_name != null){
		cellNames[1] = discount_price_name.value;
	}
//	cellNames[2] = getLanMsg("0ec22211-000034");
//	cellNames[3] = getLanMsg("0ec22211-000033");


	if(checkifTaxRate()){
		cellItems[2] = taxRate;
		cellNames[2] = getLanMsg("0ec22211-000034");
	}

 	//数量
	var fieldValue;


	//校验含税单价
	if("Y" == isPartPrice){
		var count = 0;
		for(var i=0;i<hasTaxPrice.length;i++){
			if("" !=cellItems[1][i].value && !isNaN(cellItems[1][i].value)){
				count++;
			}
		}
		if(count == 0 && hasTaxPrice.length>0){
			showMsg(getLanMsg("0ec22211-000059"));
			return false;
		}
	}
 

	//检查报价明细的数量
	for(var i=0;i<amount.length;i++){
		for(var j=0;j<cellItems.length;j++){
			cellItems[j][i].value = trim(cellItems[j][i].value);
			fieldValue = cellItems[j][i].value;
		 
			if(fieldValue == "" || fieldValue == "0"){
				var isShowMsg = false;
				if((j == 0 && "Y" == isCtrlAmount) || (j != 0 && "Y" != isPartPrice)){
					isShowMsg = true;
				}
				if(isShowMsg){
					if(null != msg){
						msg = msg + "\r\n";
					}
					msg = msg + getLanMsg("0ec22211-000060") + (i+1) + getLanMsg("0ec22211-000061") + cellNames[j] + getLanMsg("0ec22211-000062");
					isShowMsg = false;
				}
			}else if(isNaN(fieldValue)){
				if(null != msg){
					msg = msg + "\r\n";
				}
				msg = msg + getLanMsg("0ec22211-000060") + (i+1) + getLanMsg("0ec22211-000061") + cellNames[j] + getLanMsg("0ec22211-000063");
			}
		}
	}
	if(msg != ""){
		showMsg(msg);
		bResult = false;
	}
	 
	return bResult;

}


function checkifTaxRate(){
		//表头
	var captionkey="";
	
	var istaxrate=false;
 	$("[name='itemskey']").each(function(){
			var itemskey= $(this).text() ;
			if("00000053"==itemskey)
				istaxrate=true;
		});
		
		
	return istaxrate;
}

/**
 * 需求：当是配置单的时候，增加非结构化物料，校验配置说明 一定必填 
 */

function checkIfConf_note(){
	var msg = "";
	
		//数量
	var config_note = document.getElementsByName("config_note");
	
	
	if(price_tplt_type!=3)
		 return "";
	//商品来源
	var prod_src = document.getElementsByName("prod_src");
	
	
	if(prod_src==null||prod_src.length==null||prod_src.length==0)
		return "";
	
	for(var i=0;i<prod_src.length;i++){
		
		if('3'!=prod_src[i].value)
			continue;
		 
		 if(config_note==null||config_note.length==null||config_note.length==0)
		 	continue;
		 if(config_note[i]==null||config_note[i]=='undefined')
		 	continue;
		if(config_note[i].value==null||config_note[i].value=="")
			msg+= getLanMsg("0ec22211-000060")+(i+1) + getLanMsg("0ec22211-000061") + "配置说明"+ getLanMsg("0ec22211-000062");
	 
	}
	
	return msg;
 

}


//校验必输项
function checkInput(){
	

	//是否产品项
	var isProdItem = document.getElementsByName("is_prod_item");
	//合计金额
	var totalAmount = document.getElementsByName("total_amount");
	//数量
	var amount = document.getElementsByName("amount");
	//含税单价
	var hasTaxPrice = document.getElementsByName("has_tax_price");
	//税率
	var taxRate = document.getElementsByName("tax_rate");
	//折扣率
	var detailDiscount = document.getElementsByName("detail_discount");
	
	//折后单价
	var discount_net_price = document.getElementsByName("discount_net_price");
	
	
	var discount_price_name=document.getElementById("discount_price_name");
	
	
	//看界面上有没有税率这一列，如果有，则校验
	

	
	
	var bResult = true;
	var msg = "";
	var cellItems = new Array();
	cellItems[0] = amount;
	cellItems[1] = discount_net_price;
//	cellItems[2] = taxRate;
//	cellItems[3] = detailDiscount;

	var cellNames = new Array();
	cellNames[0] = getLanMsg("0ec22211-000023");
	if(discount_price_name != null){
		cellNames[1] =discount_price_name.value;
	}
//	cellNames[2] = getLanMsg("0ec22211-000034");
//	cellNames[3] = getLanMsg("0ec22211-000033");
	
	if(checkifTaxRate()){
		cellItems[2] = taxRate;
		cellNames[2] = getLanMsg("0ec22211-000034");
	}
	
	//数量
	var fieldValue;

	//校验含税单价
	if("Y" == isPartPrice){
		var count = 0;
		for(var i=0;i<hasTaxPrice.length;i++){
			if("" !=cellItems[1][i].value && !isNaN(cellItems[1][i].value)){
				count++;
			}
		}
		if(count == 0 && hasTaxPrice.length>0){
			showMsg(getLanMsg("0ec22211-000059"));
			return false;
		}
	}
	//检查报价明细的数量
	for(var i=0;i<amount.length;i++){
		for(var j=0;j<cellItems.length;j++){
			cellItems[j][i].value = trim(cellItems[j][i].value);
			fieldValue = cellItems[j][i].value;
			if(fieldValue == "" || fieldValue == "0"){
				var isShowMsg = false;
				if((j == 0 && "Y" == isCtrlAmount) || (j != 0 && "Y" != isPartPrice)){
					isShowMsg = true;
				}
				if(isShowMsg){
					if(null != msg){
						msg = msg + "\r\n";
					}
					msg = msg + getLanMsg("0ec22211-000060") + (i+1) + getLanMsg("0ec22211-000061") + cellNames[j] + getLanMsg("0ec22211-000062");
					isShowMsg = false;
				}
			}else if(isNaN(fieldValue)){
				if(null != msg){
					msg = msg + "\r\n";
				}
				msg = msg + getLanMsg("0ec22211-000060") + (i+1) + getLanMsg("0ec22211-000061") + cellNames[j] + getLanMsg("0ec22211-000063");
			}
		}
	}
	
	
	
	//检查报价单元的合计金额
	for(var i=0;i<totalAmount.length;i++){
		totalAmount[i].value = trim(totalAmount[i].value);
		fieldValue = totalAmount[i].value;
		if(fieldValue == ""){
			if(null != msg){
				msg = msg + "\r\n";
			}
			msg = msg + getLanMsg("0ec22211-000064") + (i+1) + getLanMsg("0ec22211-000065");
		}else if(isNaN(fieldValue)){
			if(null != msg){
				msg = msg + "\r\n";
			}
			msg = msg + getLanMsg("0ec22211-000064") + (i+1) + getLanMsg("0ec22211-000066");
		}
	}
	//校验上传文件备注长度
	var objFileNote = document.getElementsByName("fileMemo");
	for(var i=0;i<objFileNote.length;i++){
		if(len(objFileNote[i].value) > 50){
			msg = msg + getLanMsg("0ec22211-000090") + (i+1) + getLanMsg("0ec22211-000091");
		}
	}
	
	msg+=checkIfConf_note();
	
	if(msg != ""){
		showMsg(msg);
		bResult = false;
	}
	return bResult;
}

//报价数据签名
function doVerifyPriceData(){
	//报价单元合计金额
	var totalPrice = document.getElementsByName("total_amount");
	//是否产品项
	var isProdItem = document.getElementsByName("is_prod_item");
	//产品明细报价
	//数量
	var amount = document.getElementsByName("amount");
	//含税单价
	var hasTaxPrice = document.getElementsByName("has_tax_price");
	//税率
	var taxRate = document.getElementsByName("tax_rate");
	//折扣率
	var detailDiscount = document.getElementsByName("detail_discount");
	
	//待签名消息串
	var strVerifyPriceData = "";
	//证书SN
	var strSn = getSN(strUserCode);
	if(strSn == null || strSn == ""){
		showMsg(getLanMsg("0ec22211-000058"));
		return false;
	}
	document.replyform.casn.value = strSn;
	for(var i=0;i<totalPrice.length;i++){
		strVerifyPriceData = totalPrice[i].value + "|";
		if(isProdItem[i].value == "Y" && amount != null && amount != "null"){
			for(var j=0;j<amount.length;j++){
				strVerifyPriceData = strVerifyPriceData + amount[j].value + "|";
				strVerifyPriceData = strVerifyPriceData + hasTaxPrice[j].value + "|";
				strVerifyPriceData = strVerifyPriceData + taxRate[j].value + "|";
				strVerifyPriceData = strVerifyPriceData + detailDiscount[j].value + "|";
				//strVerifyPriceData = strVerifyPriceData + xmb[j].value + "|";//蜀电
			}
		}
		//签名
		document.getElementsByName("signature")[i].value = signmessage(strVerifyPriceData,strUserCode);
	}
	return true;
}
//增加报价信息
function addProdItem(){
	intProdCount++;
	//供方产品编码
	var strProdCode = getLanMsg("0ec22211-000026");
	var strProdCodeObjs = document.getElementsByName("sup_prodcode");
	var strProdCodeValues = new Array();
	for(var i=0;i<strProdCodeObjs.length;i++){
		strProdCodeValues[i] = strProdCodeObjs[i].value;
	}
	//规格
	var strProdSpec = getLanMsg("0ec22211-000027");
	var strProdSpecObjs = document.getElementsByName("prod_spec");
	var strProdSpecValues = new Array();
	for(var i=0;i<strProdSpecObjs.length;i++){
		strProdSpecValues[i] = strProdSpecObjs[i].value;
	}
	//型号
	var strProdType = getLanMsg("0ec22211-000028");
	var strProdTypeObjs = document.getElementsByName("prod_type");
	var strProdTypeValues = new Array();
	for(var i=0;i<strProdTypeObjs.length;i++){
		strProdTypeValues[i] = strProdTypeObjs[i].value;
	}
	//描述
	var strProdMemo = getLanMsg("0ec22211-000031");
	var strProdMemoObjs = document.getElementsByName("config_note");
	var strProdMemoValues = new Array();
	for(var i=0;i<strProdMemoObjs.length;i++){
		strProdMemoValues[i] = strProdMemoObjs[i].value;
	}
	//数量
	var strProdAmount = getLanMsg("0ec22211-000023");
	var strProdAmountObjs = document.getElementsByName("amount");
	var strProdAmountValues = new Array();
	for(var i=0;i<strProdAmountObjs.length;i++){
		strProdAmountValues[i] = strProdAmountObjs[i].value;
	}
	//单位
	var strProdUnit = getLanMsg("0ec22211-000037");
	var strProdUnitObjs = document.getElementsByName("prod_unit_name");
	var strProdUnitValues = new Array();
	for(var i=0;i<strProdUnitObjs.length;i++){
		strProdUnitValues[i] = strProdUnitObjs[i].value;
	}
	//含税单价
	var strHaxTaxPrice = getLanMsg("0ec22211-000032");
	var strHaxTaxPriceObjs = document.getElementsByName("has_tax_price");
	var strHaxTaxPriceValues = new Array();
	for(var i=0;i<strHaxTaxPriceObjs.length;i++){
		strHaxTaxPriceValues[i] = strHaxTaxPriceObjs[i].value;
	}
	//折扣率
	var strDiscount = getLanMsg("0ec22211-000033");
	var strDiscountObjs = document.getElementsByName("detail_discount");
	var strDiscountValues = new Array();
	for(var i=0;i<strDiscountObjs.length;i++){
		strDiscountValues[i] = strDiscountObjs[i].value;
	}
	//税率
	var strTaxRate = getLanMsg("0ec22211-000034");
	var strTaxRateObjs = document.getElementsByName("tax_rate");
	var strTaxRateValues = new Array();
	for(var i=0;i<strTaxRateObjs.length;i++){
		strTaxRateValues[i] = strTaxRateObjs[i].value;
	}
	//折后单价
	var strDiscountNetPrice = getLanMsg("0ec22211-000035");
	var strDiscountNetPriceObjs = document.getElementsByName("discount_net_price");
	var strDiscountNetPriceValues = new Array();
	for(var i=0;i<strDiscountNetPriceObjs.length;i++){
		strDiscountNetPriceValues[i] = strDiscountNetPriceObjs[i].value;
	}
	//折后金额
	var strDiscountAmountObjs = document.getElementsByName("discount_net_sum");
	var strDiscountAmountValues = new Array();
	for(var i=0;i<strDiscountAmountObjs.length;i++){
		strDiscountAmountValues[i] = strDiscountAmountObjs[i].value;
	}
	
	var strProdHtml = $(".bid_products").html();
	
	//level 1 start
	strProdHtml = strProdHtml + "<div id='" + intProdCount + "' class='bid_products_body bg_f8'>";
	//隐藏字段
	strProdHtml = strProdHtml + "<input type='hidden' id='row_id' name='row_id' value='"+intProdCount+"' />";
	strProdHtml = strProdHtml + "<input type='hidden' id='pk_pricetplt_b' name='pk_pricetplt_b' value=''/>";
	strProdHtml = strProdHtml + "<input type='hidden' id='pk_pricedata_b' name='pk_pricedata_b' value=''/>";
	strProdHtml = strProdHtml + "<input type='hidden' id='detail_pk_pricetplt_h' name='detail_pk_pricetplt_h' value=''/>";
	strProdHtml = strProdHtml + "<input type='hidden' id='pk_prod' name='pk_prod' value=''/>";
	strProdHtml = strProdHtml + "<input type='hidden' id='pk_prod_v' name='pk_prod_v' value=''/>";
	strProdHtml = strProdHtml + "<input type='hidden' id='pk_prod_cls' name='pk_prod_cls' value=''/>";
	strProdHtml = strProdHtml + "<input type='hidden' id='pk_prod_unit' name='pk_prod_unit' value=''/>";
	strProdHtml = strProdHtml + "<input type='hidden' id='prod_src' name='prod_src' value=''/>";
	strProdHtml = strProdHtml + "<input type='hidden' id='prod_name' name='prod_name' value=''/>";
	//level 2 start
	strProdHtml = strProdHtml + "	<div class='first_column'>";
	//level 3 start
	strProdHtml = strProdHtml + "		<div class='form_row w_100ps' style='margin-left:17px;'>";
	//level 4 start-end
	strProdHtml = strProdHtml + "			<div class='form_title w_80px'>" + strProdCode + "</div>";
	//level 4 start
	strProdHtml = strProdHtml + "			<div class='form_field'>";
	strProdHtml = strProdHtml + "				<input type='text' id='sup_prodcode' name='sup_prodcode' class='textfield pd_2px w_100px h_12px' style='background-color:white;' value='' />";
	//level 4 end
	strProdHtml = strProdHtml + "			</div>";
	//level 3 end
	strProdHtml = strProdHtml + "		</div>";
	//level 3 start
	strProdHtml = strProdHtml + "		<dl class='bid_product_config' style='margin-top:0px;margin-bottom:0px'>";
	//level 4 start-end
	strProdHtml = strProdHtml + "			<dt>" + strProdSpec + "</dt>";
	//level 4 start-end
	strProdHtml = strProdHtml + "			<dd><input type='text' id='prod_spec' name='prod_spec' class='textfield pd_2px w_100px h_12px' style='background-color:white;' value='' /></dd>";
	//level 3 end
	strProdHtml = strProdHtml + "		</dl>";
	//level 3 start
	strProdHtml = strProdHtml + "		<dl class='bid_product_config' style='margin-top:0px;margin-bottom:0px'>";
	//level 4 start-end
	strProdHtml = strProdHtml + "			<dt>" + strProdType + "</dt>";
	//level 4 start-end
	strProdHtml = strProdHtml + "			<dd><input type='text' id='prod_type' name='prod_type' class='textfield pd_2px w_100px h_12px' style='background-color:white;' value='' /></dd>";
	//level 3 end
	strProdHtml = strProdHtml + "		</dl>";
	//level 3 start
	strProdHtml = strProdHtml + "		<dl class='bid_product_config' style='margin-top:0px;'>";
	//level 4 start-end
	strProdHtml = strProdHtml + "			<dt>" + strProdMemo + "</dt>";
	//level 4 start-end
	strProdHtml = strProdHtml + "			<dd><input type='text' id='config_note' name='config_note' class='textfield pd_2px w_100px h_12px' style='background-color:white;' value='' /></dd>";
	//level 3 end
	strProdHtml = strProdHtml + "		</dl>";
	//level 2 end
	strProdHtml = strProdHtml + "	</div>";
	//level 2 start
	strProdHtml = strProdHtml + "	<div class='amount_column'>";
	//level 3 start
	strProdHtml = strProdHtml + "		<dl class='bid_product_config' style='margin-left:0px;margin-top:0px;margin-bottom:0px'>";
	//level 4 start-end
	strProdHtml = strProdHtml + "			<dt>" + strProdAmount + "</dt>";
	//level 4 start-end
	strProdHtml = strProdHtml + "			<dd style='width:59px'><input type='text' id='amount' name='amount' class='textfield pd_2px w_100px h_12px' style='background-color:white;' onchange='subReduNum(this,2);doCalPrice("+intProdCount+");' onkeypress='javascript:keyPress(this,event);' value='0' /></dd>";
	//level 3 end
	strProdHtml = strProdHtml + "		</dl>";
	//level 3 start
	strProdHtml = strProdHtml + "		<dl class='bid_product_config' style='margin-left:0px;margin-top:0px;margin-bottom:0px'>";
	//level 4 start-end
	strProdHtml = strProdHtml + "			<dt>" + strProdUnit + "</dt>";
	//level 4 start-end
	strProdHtml = strProdHtml + "			<dd style='width:59px'><input type='text' id='prod_unit_name' name='prod_unit_name' class='textfield pd_2px w_100px h_12px' style='background-color:white;' value='' /></dd>";
	//level 3 end
	strProdHtml = strProdHtml + "		</dl>";
	//level 2 end
	strProdHtml = strProdHtml + "	</div>";
	//level 2 start
	strProdHtml = strProdHtml + "	<div class='price_column'>";
	//level 3 start
	strProdHtml = strProdHtml + "		<div class='form_row w_100ps'>";
	//level 4 start-end
	strProdHtml = strProdHtml + "			<div class='form_title' style='text-align:left;width:48px;'>" + strHaxTaxPrice + "</div>";
	//level 4 start
	strProdHtml = strProdHtml + "			<div class='form_field'><label>";
	//level 5 start
	strProdHtml = strProdHtml + "				<label>";
	//level 6 start
	strProdHtml = strProdHtml + "					<input type='text' id='has_tax_price' name='has_tax_price' class='textfield pd_2px w_100px h_12px' onchange='subReduNum(this,2);doCalPrice("+intProdCount+");' onkeypress='javascript:keyPress(this,event);' value='' />";
	//level 5 start
	strProdHtml = strProdHtml + "			 	</label>";
	//level 4 end
	strProdHtml = strProdHtml + "			 </div>";
	//level 3 end
	strProdHtml = strProdHtml + "		</div>";
	//level 3 start
	strProdHtml = strProdHtml + "		<div class='form_row w_100ps'>";
	//level 4 start-end
	strProdHtml = strProdHtml + "			<div class='form_title' style='text-align:left;width:48px;'>" + strDiscount + "</div>";
	//level 4 start
	strProdHtml = strProdHtml + "			<div class='form_field'><label>";
	//level 5 start
	strProdHtml = strProdHtml + "				<label>";
	//level 6 start
	strProdHtml = strProdHtml + "					<input type='text' id='detail_discount' name='detail_discount' class='textfield pd_2px w_100px h_12px' onchange='subReduNum(this,2);doCalPrice("+intProdCount+");' onkeypress='javascript:keyPress(this,event);' value='' />";
	//level 5 start
	strProdHtml = strProdHtml + "			 	</label>";
	//level 4 end
	strProdHtml = strProdHtml + "			 </div>";
	//level 3 end
	strProdHtml = strProdHtml + "		</div>";
	//level 3 start
	strProdHtml = strProdHtml + "		<div class='form_row w_100ps'>";
	//level 4 start-end
	strProdHtml = strProdHtml + "			<div class='form_title' style='text-align:left;width:48px;'>" + strTaxRate + "</div>";
	//level 4 start
	strProdHtml = strProdHtml + "			<div class='form_field'><label>";
	//level 5 start
	strProdHtml = strProdHtml + "				<label>";
	//level 6 start
	strProdHtml = strProdHtml + "					<input type='text' id='tax_rate' name='tax_rate' class='textfield pd_2px w_100px h_12px' onchange='subReduNum(this,2);doCalPrice("+intProdCount+");' onkeypress='javascript:keyPress(this,event);' value='' />";
	//level 5 start
	strProdHtml = strProdHtml + "			 	</label>";
	//level 4 end
	strProdHtml = strProdHtml + "			 </div>";
	//level 3 end
	strProdHtml = strProdHtml + "		</div>";
	//level 3 start
	strProdHtml = strProdHtml + "		<div class='form_row w_100ps'>";
	//level 4 start-end
	strProdHtml = strProdHtml + "			<div class='form_title' style='text-align:left;width:48px;'>" + strDiscountNetPrice + "</div>";
	//level 4 start
	strProdHtml = strProdHtml + "			<div class='form_field'><label>";
	//level 5 start
	strProdHtml = strProdHtml + "				<label>";
	//level 6 start
	strProdHtml = strProdHtml + "					<input type='text' id='discount_net_price' name='discount_net_price' class='textfield pd_2px w_100px h_12px' value='' readonly/>";
	//level 5 start
	strProdHtml = strProdHtml + "			 	</label>";
	//level 4 end
	strProdHtml = strProdHtml + "			 </div>";
	//level 3 end
	strProdHtml = strProdHtml + "		</div>";
	//level 2 end
	strProdHtml = strProdHtml + "	</div>";
	//level 2 start
	strProdHtml = strProdHtml + "	<div class='last_column'>";
	//level 3 start
	strProdHtml = strProdHtml + "		<span>";
	//level 4
	strProdHtml = strProdHtml + "			<input type='text' id='discount_net_sum' name='discount_net_sum' class='textfield pd_2px w_100px color_f73107' style='border-style:none;text-align:right' value='' readonly />";
	//level 3 end
	strProdHtml = strProdHtml + "		</span>";
	//level 2 end
	strProdHtml = strProdHtml + "	</div>";
	//level 2 start
	strProdHtml = strProdHtml + "	<div class='btn_column'>";
	//level 3
	strProdHtml = strProdHtml + "		<a class='btn_delete mrg_0x15px deleteprod hand' onclick='removeProdItem("+intProdCount+")'></a>";
	//level 2 end
	strProdHtml = strProdHtml + "	</div>";
	//level 1 end
	strProdHtml = strProdHtml + "</div>";
	$(".bid_products").html(strProdHtml);
	//供方产品编码
	for(var i=0;i<strProdCodeValues.length;i++){
		strProdCodeObjs[i].value = strProdCodeValues[i]; 
	}
	//规格
	for(var i=0;i<strProdSpecValues.length;i++){
		strProdSpecObjs[i].value = strProdSpecValues[i]; 
	}
	//型号
	for(var i=0;i<strProdTypeValues.length;i++){
		strProdTypeObjs[i].value = strProdTypeValues[i]; 
	}
	//描述
	for(var i=0;i<strProdMemoValues.length;i++){
		strProdMemoObjs[i].value = strProdMemoValues[i]; 
	}
	//数量
	for(var i=0;i<strProdAmountValues.length;i++){
		strProdAmountObjs[i].value = strProdAmountValues[i]; 
	}
	//单位
	for(var i=0;i<strProdUnitValues.length;i++){
		strProdUnitObjs[i].value = strProdUnitValues[i]; 
	}
	//含税单价
	for(var i=0;i<strHaxTaxPriceValues.length;i++){
		strHaxTaxPriceObjs[i].value = strHaxTaxPriceValues[i]; 
	}
	//折扣率
	for(var i=0;i< strDiscountValues.length;i++){
		 strDiscountObjs[i].value =  strDiscountValues[i]; 
	}
	//税率
	for(var i=0;i<strTaxRateValues.length;i++){
		strTaxRateObjs[i].value = strTaxRateValues[i]; 
	}
	//折后单价
	for(var i=0;i<strDiscountNetPriceValues.length;i++){
		strDiscountNetPriceObjs[i].value = strDiscountNetPriceValues[i]; 
	}
	//折后金额
	for(var i=0;i<strDiscountAmountValues.length;i++){
		strDiscountAmountObjs[i].value = strDiscountAmountValues[i]; 
	}
	//alert($(".bid_products").html());
}


//删除报价行
function removeProdItem(index) {

	 
	$("#"+index).remove();
	//重新计算合计
	var editrow=index-1;
	
	if(editrow!=0)
	
		doCalPrice(editrow);
}



function addProdItemnew(){
   var hitl = $(".option").last().html();
   var optinolength = $(".option").length;
   optinolength +=1;
   var time = isDateTimea();
   var strProdHtmlnew = "";
   //隐藏字段
//	strProdHtmlnew = strProdHtmlnew + "<input type='hidden' id='row_id' name='row_id' value='"+intProdCount+"' />";
	strProdHtmlnew = strProdHtmlnew + "<input type='hidden' id='pk_pricedata_b' name='pk_pricedata_b' value=''/>";
    strProdHtmlnew = strProdHtmlnew + "<input type='hidden' id='detail_pk_pricetplt_h' name='detail_pk_pricetplt_h' value=''/>";
    strProdHtmlnew = strProdHtmlnew + "<input type='hidden' id='pk_pricetplt_b' name='pk_pricetplt_b' value=''/>";
    strProdHtmlnew = strProdHtmlnew + "<input type='hidden' id='pk_prod' name='pk_prod' value=''/>";
    strProdHtmlnew = strProdHtmlnew + "<input type='hidden' id='pk_prod_v' name='pk_prod_v' value=''/>";
    strProdHtmlnew = strProdHtmlnew + "<input type='hidden' id='pk_prod_cls' name='pk_prod_cls' value=''/>";
    strProdHtmlnew = strProdHtmlnew + "<input type='hidden' id='pk_prod_unit' name='pk_prod_unit' value=''/>";
    strProdHtmlnew = strProdHtmlnew + "<input type='hidden' id='prod_src' name='prod_src' value='3'/>";
    strProdHtmlnew = strProdHtmlnew + "<input type='hidden' id='amount_precision' name='amount_precision' value=''/>";
    strProdHtmlnew = strProdHtmlnew + "<input type='hidden' id='row_id' name='row_id' value='"+(optinolength + 1)+"'/>";
    strProdHtmlnew = strProdHtmlnew + "<input type='hidden' id='fun_msg' name='fun_msg' value='0'/>";
    strProdHtmlnew = strProdHtmlnew + "<input type='hidden' id='title_type' name='title_type' value='0'/>";
    strProdHtmlnew = strProdHtmlnew + "<input type='hidden' id='type_title' name='type_title' value='0'/>";
    strProdHtmlnew = strProdHtmlnew + "<input class='quote_area' type='hidden' id='quote_area' name='quote_area' value=''/>";
   
   $(".option").last().parent().append( "<tr nujian='' nujvalue='1' id='option' class='option  "+optinolength+"'>"+ strProdHtmlnew+ hitl+"</tr>");
   var btnnem = $(".option").last().find("td").last().find("a").attr("class").split(" ");
   var fiek = 0;
   for ( var rowsLoogpa = 0; rowsLoogpa < btnnem.length; rowsLoogpa++) {
					var idameit = btnnem[rowsLoogpa];
					idameit = trim(idameit);
					if(idameit == "btn_fdelete"){
						fiek = 1;
					}
				}
   
   if(fiek == 1){
   $(".option").last().find("td").last().find("a").removeClass("btn_fdelete");
   $(".option").last().find("td").last().find("a").addClass("btn_delete");
   }
   		//$(".option").last().find("td").last().find("a").css({ 'btn_fdelete': "hidden" });
   		//.removeClass()
   		//.attr("btn_fdelete")
   		
   $(".option").last().find("td").last().find("a").attr("onclick","removeProdItemnew("+optinolength+")");
	var btnnemasrc = $(".option").last().find("input[id='prod_fig_src']");
	var btnnemasrcvalue =$(btnnemasrc).val();
	if(btnnemasrcvalue != 3){
		$(".option").last().find("td").first().html("");
		var strProdHtmlhi = "";
		strProdHtmlhi = strProdHtmlhi + "<div style='margin-left: 17px;'>";
		strProdHtmlhi = strProdHtmlhi + "<div class='form_title '>";
		strProdHtmlhi = strProdHtmlhi + "<span>编码：</span><input type='text' value='' class='textfield pd_2px w_100px h_12px' name='sup_prodcode' id='sup_prodcode' style='float:none;'>";
		strProdHtmlhi = strProdHtmlhi + "<span>规格：</span><input type='text' value='' class='textfield pd_2px w_100px h_12px' name='prod_spec' id='prod_spec' style='float:none;'>";
		strProdHtmlhi = strProdHtmlhi + "<span>型号：</span><input type='text' value='' class='textfield pd_2px w_100px h_12px' name='prod_type' id='prod_type' style='float:none;'>";
		strProdHtmlhi = strProdHtmlhi + "<div class='form_field'> </div> </div>";
		$(".option").last().find("td").first().html(strProdHtmlhi);					
	}			
	var inpalu = null;
	var btnnema = $(".option").last().find("input[type='text']");
	for ( var rowsLoogpa = 0; rowsLoogpa < btnnema.length; rowsLoogpa++) {
		var idameit = btnnema[rowsLoogpa];
		var syinput = $(idameit);
		if(1!=1){
		
		
		var onchangevalur = syinput.attr("onchange");
		if(typeof(onchangevalur)=="undefined"){
			
		} else {
			var onzxinhmlt = "";
			var onchanvaues = onchangevalur.split(";");
			for ( var rowsLoogpa = 0; rowsLoogpa < onchanvaues.length; rowsLoogpa++) {
				var onvas = onchanvaues[rowsLoogpa].trim();
				if(onvas.indexOf("subReduNum") != -1){
					var strValue = onvas.replace(optinolength, "4");				
					onzxinhmlt = onzxinhmlt+strValue+";";
				} else if(onvas.indexOf("doCalPrice") != -1){
					var strValue = onvas.replace(optinolength, optinolength+1);				
					onzxinhmlt = onzxinhmlt+strValue+";";
				}else if(onvas.indexOf("docal_discount_net_price") != -1){
					//var strValue = onvas.replace(optinolength, optinolength+1);				
					//onzxinhmlt = onzxinhmlt+strValue+";";
					continue;
				}else if(onvas.indexOf("docalPricedata") != -1){
					var strValue = onvas.replace(optinolength, optinolength+1);				
					onzxinhmlt = onzxinhmlt+strValue+";";
				}else if(onvas.indexOf("cal_dis_price") != -1){
					var strValue = onvas.replace(optinolength, optinolength+1);				
					onzxinhmlt = onzxinhmlt+strValue+";";
				}else if(onvas.indexOf("shabi") != -1){
					var strValue = onvas.replace(optinolength, optinolength+1);				
					onzxinhmlt = onzxinhmlt+strValue+";";
				} else {
					onzxinhmlt = onzxinhmlt+onchanvaues[rowsLoogpa]+";";
				}
				syinput.attr("onchange",onzxinhmlt);
			}
		}
		}
		syinput.val("");
		
	}
	var btnnema1 = $(".option").last().find("input[id='amount']");
	for ( var rowsLoogpa = 0; rowsLoogpa < btnnema1.length; rowsLoogpa++) {
		var idameit1 = btnnema1[rowsLoogpa];
		var fds = $(idameit1).parent();
		fds.html("");
		fds.html("<input type='text'  value='' class='textfield pd_2px w_100px h_12px mnytxt' name='amount' id='amount'>");
		var fds1 = fds.next();
		fds1.html("");
		fds1.html("<input type='text'  value='' class='textfield pd_2px w_100px h_12px mnytxt' name='prod_unit_name' id='prod_unit_name'>");
	}
	
	if(1!=1){
	intProdCount++;
	//供方产品编码
	var strProdCode = getLanMsg("0ec22211-000026");
	var strProdCodeObjs = document.getElementsByName("sup_prodcode");
	var strProdCodeValues = new Array();
	for(var i=0;i<strProdCodeObjs.length;i++){
		strProdCodeValues[i] = strProdCodeObjs[i].value;
	}
	//规格
	var strProdSpec = getLanMsg("0ec22211-000027");
	var strProdSpecObjs = document.getElementsByName("prod_spec");
	var strProdSpecValues = new Array();
	for(var i=0;i<strProdSpecObjs.length;i++){
		strProdSpecValues[i] = strProdSpecObjs[i].value;
	}
	//型号
	var strProdType = getLanMsg("0ec22211-000028");
	var strProdTypeObjs = document.getElementsByName("prod_type");
	var strProdTypeValues = new Array();
	for(var i=0;i<strProdTypeObjs.length;i++){
		strProdTypeValues[i] = strProdTypeObjs[i].value;
	}
	//描述
	var strProdMemo = getLanMsg("0ec22211-000031");
	var strProdMemoObjs = document.getElementsByName("config_note");
	var strProdMemoValues = new Array();
	for(var i=0;i<strProdMemoObjs.length;i++){
		strProdMemoValues[i] = strProdMemoObjs[i].value;
	}
	//数量
	var strProdAmount = getLanMsg("0ec22211-000023");
	var strProdAmountObjs = document.getElementsByName("amount");
	var strProdAmountValues = new Array();
	for(var i=0;i<strProdAmountObjs.length;i++){
		strProdAmountValues[i] = strProdAmountObjs[i].value;
	}
	//单位
	var strProdUnit = getLanMsg("0ec22211-000037");
	var strProdUnitObjs = document.getElementsByName("prod_unit_name");
	var strProdUnitValues = new Array();
	for(var i=0;i<strProdUnitObjs.length;i++){
		strProdUnitValues[i] = strProdUnitObjs[i].value;
	}
	//含税单价
	var strHaxTaxPrice = getLanMsg("0ec22211-000032");
	var strHaxTaxPriceObjs = document.getElementsByName("has_tax_price");
	var strHaxTaxPriceValues = new Array();
	for(var i=0;i<strHaxTaxPriceObjs.length;i++){
		strHaxTaxPriceValues[i] = strHaxTaxPriceObjs[i].value;
	}
	//折扣率
	var strDiscount = getLanMsg("0ec22211-000033");
	var strDiscountObjs = document.getElementsByName("detail_discount");
	var strDiscountValues = new Array();
	for(var i=0;i<strDiscountObjs.length;i++){
		strDiscountValues[i] = strDiscountObjs[i].value;
	}
	//税率
	var strTaxRate = getLanMsg("0ec22211-000034");
	var strTaxRateObjs = document.getElementsByName("tax_rate");
	var strTaxRateValues = new Array();
	for(var i=0;i<strTaxRateObjs.length;i++){
		strTaxRateValues[i] = strTaxRateObjs[i].value;
	}
	//折后单价
	var strDiscountNetPrice = getLanMsg("0ec22211-000035");
	var strDiscountNetPriceObjs = document.getElementsByName("discount_net_price");
	var strDiscountNetPriceValues = new Array();
	for(var i=0;i<strDiscountNetPriceObjs.length;i++){
		strDiscountNetPriceValues[i] = strDiscountNetPriceObjs[i].value;
	}
	//折后金额
	var strDiscountAmountObjs = document.getElementsByName("discount_net_sum");
	var strDiscountAmountValues = new Array();
	for(var i=0;i<strDiscountAmountObjs.length;i++){
		strDiscountAmountValues[i] = strDiscountAmountObjs[i].value;
	}
	
	var strProdHtml = $(".bid_products").html();
	
	//level 1 start
	strProdHtml = strProdHtml + "<div id='" + intProdCount + "' class='bid_products_body bg_f8'>";
	//隐藏字段
	strProdHtml = strProdHtml + "<input type='hidden' id='row_id' name='row_id' value='"+intProdCount+"' />";
	strProdHtml = strProdHtml + "<input type='hidden' id='pk_pricetplt_b' name='pk_pricetplt_b' value=''/>";
	strProdHtml = strProdHtml + "<input type='hidden' id='pk_pricedata_b' name='pk_pricedata_b' value=''/>";
	strProdHtml = strProdHtml + "<input type='hidden' id='detail_pk_pricetplt_h' name='detail_pk_pricetplt_h' value=''/>";
	strProdHtml = strProdHtml + "<input type='hidden' id='pk_prod' name='pk_prod' value=''/>";
	strProdHtml = strProdHtml + "<input type='hidden' id='pk_prod_v' name='pk_prod_v' value=''/>";
	strProdHtml = strProdHtml + "<input type='hidden' id='pk_prod_cls' name='pk_prod_cls' value=''/>";
	strProdHtml = strProdHtml + "<input type='hidden' id='pk_prod_unit' name='pk_prod_unit' value=''/>";
	strProdHtml = strProdHtml + "<input type='hidden' id='prod_src' name='prod_src' value=''/>";
	strProdHtml = strProdHtml + "<input type='hidden' id='prod_name' name='prod_name' value=''/>";
	//level 2 start
	strProdHtml = strProdHtml + "	<div class='first_column'>";
	//level 3 start
	strProdHtml = strProdHtml + "		<div class='form_row w_100ps' style='margin-left:17px;'>";
	//level 4 start-end
	strProdHtml = strProdHtml + "			<div class='form_title w_80px'>" + strProdCode + "</div>";
	//level 4 start
	strProdHtml = strProdHtml + "			<div class='form_field'>";
	strProdHtml = strProdHtml + "				<input type='text' id='sup_prodcode' name='sup_prodcode' class='textfield pd_2px w_100px h_12px' style='background-color:white;' value='' />";
	//level 4 end
	strProdHtml = strProdHtml + "			</div>";
	//level 3 end
	strProdHtml = strProdHtml + "		</div>";
	//level 3 start
	strProdHtml = strProdHtml + "		<dl class='bid_product_config' style='margin-top:0px;margin-bottom:0px'>";
	//level 4 start-end
	strProdHtml = strProdHtml + "			<dt>" + strProdSpec + "</dt>";
	//level 4 start-end
	strProdHtml = strProdHtml + "			<dd><input type='text' id='prod_spec' name='prod_spec' class='textfield pd_2px w_100px h_12px' style='background-color:white;' value='' /></dd>";
	//level 3 end
	strProdHtml = strProdHtml + "		</dl>";
	//level 3 start
	strProdHtml = strProdHtml + "		<dl class='bid_product_config' style='margin-top:0px;margin-bottom:0px'>";
	//level 4 start-end
	strProdHtml = strProdHtml + "			<dt>" + strProdType + "</dt>";
	//level 4 start-end
	strProdHtml = strProdHtml + "			<dd><input type='text' id='prod_type' name='prod_type' class='textfield pd_2px w_100px h_12px' style='background-color:white;' value='' /></dd>";
	//level 3 end
	strProdHtml = strProdHtml + "		</dl>";
	//level 3 start
	strProdHtml = strProdHtml + "		<dl class='bid_product_config' style='margin-top:0px;'>";
	//level 4 start-end
	strProdHtml = strProdHtml + "			<dt>" + strProdMemo + "</dt>";
	//level 4 start-end
	strProdHtml = strProdHtml + "			<dd><input type='text' id='config_note' name='config_note' class='textfield pd_2px w_100px h_12px' style='background-color:white;' value='' /></dd>";
	//level 3 end
	strProdHtml = strProdHtml + "		</dl>";
	//level 2 end
	strProdHtml = strProdHtml + "	</div>";
	//level 2 start
	strProdHtml = strProdHtml + "	<div class='amount_column'>";
	//level 3 start
	strProdHtml = strProdHtml + "		<dl class='bid_product_config' style='margin-left:0px;margin-top:0px;margin-bottom:0px'>";
	//level 4 start-end
	strProdHtml = strProdHtml + "			<dt>" + strProdAmount + "</dt>";
	//level 4 start-end
	strProdHtml = strProdHtml + "			<dd style='width:59px'><input type='text' id='amount' name='amount' class='textfield pd_2px w_100px h_12px' style='background-color:white;' onchange='subReduNum(this,2);doCalPrice("+intProdCount+");' onkeypress='javascript:keyPress(this,event);' value='0' /></dd>";
	//level 3 end
	strProdHtml = strProdHtml + "		</dl>";
	//level 3 start
	strProdHtml = strProdHtml + "		<dl class='bid_product_config' style='margin-left:0px;margin-top:0px;margin-bottom:0px'>";
	//level 4 start-end
	strProdHtml = strProdHtml + "			<dt>" + strProdUnit + "</dt>";
	//level 4 start-end
	strProdHtml = strProdHtml + "			<dd style='width:59px'><input type='text' id='prod_unit_name' name='prod_unit_name' class='textfield pd_2px w_100px h_12px' style='background-color:white;' value='' /></dd>";
	//level 3 end
	strProdHtml = strProdHtml + "		</dl>";
	//level 2 end
	strProdHtml = strProdHtml + "	</div>";
	//level 2 start
	strProdHtml = strProdHtml + "	<div class='price_column'>";
	//level 3 start
	strProdHtml = strProdHtml + "		<div class='form_row w_100ps'>";
	//level 4 start-end
	strProdHtml = strProdHtml + "			<div class='form_title' style='text-align:left;width:48px;'>" + strHaxTaxPrice + "</div>";
	//level 4 start
	strProdHtml = strProdHtml + "			<div class='form_field'><label>";
	//level 5 start
	strProdHtml = strProdHtml + "				<label>";
	//level 6 start
	strProdHtml = strProdHtml + "					<input type='text' id='has_tax_price' name='has_tax_price' class='textfield pd_2px w_100px h_12px' onchange='subReduNum(this,2);doCalPrice("+intProdCount+");' onkeypress='javascript:keyPress(this,event);' value='' />";
	//level 5 start
	strProdHtml = strProdHtml + "			 	</label>";
	//level 4 end
	strProdHtml = strProdHtml + "			 </div>";
	//level 3 end
	strProdHtml = strProdHtml + "		</div>";
	//level 3 start
	strProdHtml = strProdHtml + "		<div class='form_row w_100ps'>";
	//level 4 start-end
	strProdHtml = strProdHtml + "			<div class='form_title' style='text-align:left;width:48px;'>" + strDiscount + "</div>";
	//level 4 start
	strProdHtml = strProdHtml + "			<div class='form_field'><label>";
	//level 5 start
	strProdHtml = strProdHtml + "				<label>";
	//level 6 start
	strProdHtml = strProdHtml + "					<input type='text' id='detail_discount' name='detail_discount' class='textfield pd_2px w_100px h_12px' onchange='subReduNum(this,2);doCalPrice("+intProdCount+");' onkeypress='javascript:keyPress(this,event);' value='' />";
	//level 5 start
	strProdHtml = strProdHtml + "			 	</label>";
	//level 4 end
	strProdHtml = strProdHtml + "			 </div>";
	//level 3 end
	strProdHtml = strProdHtml + "		</div>";
	//level 3 start
	strProdHtml = strProdHtml + "		<div class='form_row w_100ps'>";
	//level 4 start-end
	strProdHtml = strProdHtml + "			<div class='form_title' style='text-align:left;width:48px;'>" + strTaxRate + "</div>";
	//level 4 start
	strProdHtml = strProdHtml + "			<div class='form_field'><label>";
	//level 5 start
	strProdHtml = strProdHtml + "				<label>";
	//level 6 start
	strProdHtml = strProdHtml + "					<input type='text' id='tax_rate' name='tax_rate' class='textfield pd_2px w_100px h_12px' onchange='subReduNum(this,2);doCalPrice("+intProdCount+");' onkeypress='javascript:keyPress(this,event);' value='' />";
	//level 5 start
	strProdHtml = strProdHtml + "			 	</label>";
	//level 4 end
	strProdHtml = strProdHtml + "			 </div>";
	//level 3 end
	strProdHtml = strProdHtml + "		</div>";
	//level 3 start
	strProdHtml = strProdHtml + "		<div class='form_row w_100ps'>";
	//level 4 start-end
	strProdHtml = strProdHtml + "			<div class='form_title' style='text-align:left;width:48px;'>" + strDiscountNetPrice + "</div>";
	//level 4 start
	strProdHtml = strProdHtml + "			<div class='form_field'><label>";
	//level 5 start
	strProdHtml = strProdHtml + "				<label>";
	//level 6 start
	strProdHtml = strProdHtml + "					<input type='text' id='discount_net_price' name='discount_net_price' class='textfield pd_2px w_100px h_12px' value='' readonly/>";
	//level 5 start
	strProdHtml = strProdHtml + "			 	</label>";
	//level 4 end
	strProdHtml = strProdHtml + "			 </div>";
	//level 3 end
	strProdHtml = strProdHtml + "		</div>";
	//level 2 end
	strProdHtml = strProdHtml + "	</div>";
	//level 2 start
	strProdHtml = strProdHtml + "	<div class='last_column'>";
	//level 3 start
	strProdHtml = strProdHtml + "		<span>";
	//level 4
	strProdHtml = strProdHtml + "			<input type='text' id='discount_net_sum' name='discount_net_sum' class='textfield pd_2px w_100px color_f73107' style='border-style:none;text-align:right' value='' readonly />";
	//level 3 end
	strProdHtml = strProdHtml + "		</span>";
	//level 2 end
	strProdHtml = strProdHtml + "	</div>";
	//level 2 start
	strProdHtml = strProdHtml + "	<div class='btn_column'>";
	//level 3
	strProdHtml = strProdHtml + "		<a class='btn_delete mrg_0x15px deleteprod hand' onclick='removeProdItem("+intProdCount+")'></a>";
	//level 2 end
	strProdHtml = strProdHtml + "	</div>";
	//level 1 end
	strProdHtml = strProdHtml + "</div>";
	$(".bid_products").html(strProdHtml);
	//供方产品编码
	for(var i=0;i<strProdCodeValues.length;i++){
		strProdCodeObjs[i].value = strProdCodeValues[i]; 
	}
	//规格
	for(var i=0;i<strProdSpecValues.length;i++){
		strProdSpecObjs[i].value = strProdSpecValues[i]; 
	}
	//型号
	for(var i=0;i<strProdTypeValues.length;i++){
		strProdTypeObjs[i].value = strProdTypeValues[i]; 
	}
	//描述
	for(var i=0;i<strProdMemoValues.length;i++){
		strProdMemoObjs[i].value = strProdMemoValues[i]; 
	}
	//数量
	for(var i=0;i<strProdAmountValues.length;i++){
		strProdAmountObjs[i].value = strProdAmountValues[i]; 
	}
	//单位
	for(var i=0;i<strProdUnitValues.length;i++){
		strProdUnitObjs[i].value = strProdUnitValues[i]; 
	}
	//含税单价
	for(var i=0;i<strHaxTaxPriceValues.length;i++){
		strHaxTaxPriceObjs[i].value = strHaxTaxPriceValues[i]; 
	}
	//折扣率
	for(var i=0;i< strDiscountValues.length;i++){
		 strDiscountObjs[i].value =  strDiscountValues[i]; 
	}
	//税率
	for(var i=0;i<strTaxRateValues.length;i++){
		strTaxRateObjs[i].value = strTaxRateValues[i]; 
	}
	//折后单价
	for(var i=0;i<strDiscountNetPriceValues.length;i++){
		strDiscountNetPriceObjs[i].value = strDiscountNetPriceValues[i]; 
	}
	//折后金额
	for(var i=0;i<strDiscountAmountValues.length;i++){
		strDiscountAmountObjs[i].value = strDiscountAmountValues[i]; 
	}
	//alert($(".bid_products").html());
	}
}

function isDateTimea(){
	var d= new Date();
	return d.getFullYear() +""+ d.getFullYear()+""+d.getDate()+""+d.getHours()+""+d.getMinutes()+""+d.getSeconds();
}

//删除报价行
function removeProdItemnew(index) {
	$("."+index).remove();
	//重新计算合计
//	doCalPrice();
}
// 输入框自动增长
//function DoResize()
//{
//	var nn=document.getElementById("fujian").value;
//	nn.size=nn.value.length+1;
// }
function addFileRow(pkReleaseFileB,replyFileName,replyFileSize,replyFilePath,uploadid){
	
	//报价的上传
	if(uploadid=="importpricedata"){
		importpricedatasubmit(pkReleaseFileB,replyFileName,replyFileSize,replyFilePath);
		return;
	}
	
	
	//澄清答疑上传
	if(pkReleaseFileB.length==4){
		var qafile_name = document.getElementById("qafile_name").value=replyFileName;
		var real_path = document.getElementById("real_path").value=replyFilePath;
		var file_size = document.getElementById("file_size").value=replyFileSize;
		var str = real_path+qafile_name;
		document.getElementById("all_path").value=str;
		document.getElementById("opinion").value=1;
		//$("#fujian").append("<span id='file_nameq' title=''>"+replyFileName+"</span>");
		var fujian = document.getElementById("fujian").value=replyFileName;
		
		$("#imger").show();
		$("#fujian").show();
		$(".words").hide();
		if(fujian!=null){
			var nn=document.getElementById("fujian");
			nn.size=nn.value.length+1;
		}
	}
	else{
	//删除
	var strDelBtn = getLanMsg("0ec22211-000019");
	var pubFileNaame;
	var pubFilePks = document.getElementsByName("pub_file_pk");
	var pubFileNames = document.getElementsByName("pub_file_name");
	for(var i=0;i<pubFilePks.length;i++){
		if(pubFilePks[i].value == pkReleaseFileB){
			pubFileNaame = pubFileNames[i].value;
			break;
		}
	}
	var fileTable = document.getElementById("bidFileTable");
	var rowNo = fileTable.rows.length;
	var row = fileTable.insertRow(rowNo);
	row.id = rowNo;
	if(row.id%2==0){
 		row.className="odd";
 	}
	row.align = 'left';
	//序号
	var cell = row.insertCell(0)
	cell.innerHTML = "<input type='hidden' id='reply_file_real_path' name='reply_file_real_path' value='"+replyFilePath+replyFileName+"' />"+rowNo+"";
	//采购文件名称
	cell = row.insertCell(1)
	var pubFileNaamenew =pubFileNaame.substring(0,10)+"...";
	//var pubFileNaamenew = pubFileNaame;
	cell.innerHTML = "<span title='"+pubFileNaame+"'><input  type='hidden' id='pk_release_file_b' name='pk_release_file_b' value='"+pkReleaseFileB+"' />"+pubFileNaamenew+"</span>"; 
	//应答文件名称
	cell = row.insertCell(2)
	cell.innerHTML = "<input type='text' id='reply_file_name' name='reply_file_name' class='textfield pd_5x2px' style='width:90%' value='"+replyFileName+"' />"; 
	//文件大小（字节）
	cell = row.insertCell(3)
	cell.innerHTML = "<span>"+subNumber(replyFileSize/1024)+"</span>KB"
	+"<input type='hidden' id='reply_file_size' name='reply_file_size' value='"+replyFileSize+"'/>";
	//备注
	cell = row.insertCell(4)
	cell.innerHTML = "<input type='text' id='fileMemo' name='fileMemo' size='50' class='textfield pd_5x2px' style='width:90%'/>";
	//删除
	cell = row.insertCell(5)
	cell.innerHTML = "<input type='button' class='buttondel' value='" + strDelBtn + "' onclick='delFile("+rowNo+")' />";
	cell.innerHTML = "<a id='onDelete'  class='btn_gray btn_save' href='javascript:delFile("+rowNo+");' style='margin-left:3px'><span class='w_66px'>"+ strDelBtn +"</span></a>";
}
}
//下载文件
function downloadFile(pk_file,file_name){
	document.replyform.pk_file.value = pk_file;
	document.replyform.file_name.value = file_name;
	document.replyform.action=ebvpContext+"/ebvpfile/download";
	document.replyform.submit();
}
//删除文件
function delFile(index){
	var bidFileTable = document.getElementById("bidFileTable");
	if (bidFileTable != null) {
		// 获取报价信息有多少行
		var rows = bidFileTable.rows;
		if (rows != null && rows.length > 0) {
			for ( var pos = 0; pos < rows.length; pos++) {
				var row = rows[pos];
				// 寻找要删除的row
				if (row.id == index) {
					bidFileTable.deleteRow(pos);
					//deleteFile(index);
					break;
				}
			}
		}
	}
}

function subNumber(num){
	var value = (Math.round(Math.floor(num * 1000) / 10) / 100);
	return value;
}

var roundTwo2 = function() {
    var objs = document.getElementsByName("showSize");
    if(objs != null){
     for(var i = 0; i < objs.length; i++){
      if(objs[i].innerText != null && objs[i].innerText.length != 0)
       objs[i].innerText = subNumber(objs[i].innerText);
     }
    }
}


function deleteFile(pk_file){
	document.replyform.pk_file.value = pk_file;
	document.replyform.action=ebvpContext+"/ebvpfile/deletefile";
	//提交表单
	var options3 = {
		beforeSubmit : showRequest3, 
		success : showResponse3
	};
	$('#replyform').ajaxSubmit(options3);
}
function showRequest3(formData, jqForm, options) {
}
function showResponse3(responseText, statusText, xhr, $form) {
}

//文件验签
function verifyFile(signature,index){
	var fileName = document.getElementsByName("fileName")[index-1].value
	var ret = verfiyFile(fileName,signature,strCert);
	if(ret)
		showMsg(getLanMsg("0ec22211-000068"));
	else
		showMsg(getLanMsg("0ec22211-000069"));
}

//刷新页面
function refreshPage(){
	var url = ebvpContext+"/sourcing/biddingprojlist/releasepurfileinfo?pkProj=${RELEASE_FORM.pk_pur_project}"+"&pkProjStep=${RELEASE_FORM.pk_purproj_step}"+"&type=<%=type%>";
	document.location.href = url;
}

//提交响应信息
var showMsg = function(msg){
	document.getElementById('show_msg').innerHTML = msg;
}
//显示信息
var afterReplyMsgShow = function(){
	if(msg != null && trim(msg).length != 0){
		if(msg == 'success'){
			msg = getLanMsg("0ec22211-000070");
		}
		showMsg(msg);
	}
}

function hideInform(){
	
	if(isHide){
		$(".detail").hide();
	}else{
		$(".detail").show();
	}
}

function hideInfor(isHide){
	
	if(isHide){
		$("#demand").show();
		$("#demand2").show();
		$("#demand3").hide();
	}else{
		$("#demand").hide();
		$("#demand2").hide();
		$("#demand3").show();
	}
}



function getValues(){
		
		var oldvaluetemps=oldvalue;
			var option={title : "切换区域提示",

              			content : "您确定要保存报价数据吗？",
              			confirm : function() {
	              		
							if(toAccountSecond <= 0){
								showMsg(getLanMsg("0ec22211-000057"));
								return;
							}
							if(isDelayCanReply != "true" && isHandlePass == 1){
								showMsg(getLanMsg("0ec22211-000076"));
								return;
							}
							if(checkInput()){
								//签名
								var bResult = true;
								if (isClientCa == "true") {
									bResult = doVerifyPriceData();
								}
								//提交表单
								if(bResult){
									var oldareaid= document.getElementById("old_quete_area").value;
									var area_id = document.getElementById("quete_area").value;
								
									document.replyform.action = ebvpContext+"/sourcing/biddingprojlist/purfilereply?type="+type+"&pk_areadivision="+area_id+"&oldvalue="+oldareaid;
									document.replyform.submit();
								}
							}
							
							
              			},
              			 cancel : function() {
              			  		var area_id = document.getElementById("quete_area").value;
									document.getElementById('replyform').action =ebvpContext+"/sourcing/biddingprojlist/releasepurfilearea?pk_areadivision="+area_id+"&pkProjStep="+strProjStepPk+"&pkProj="+strProjPk;
						 			document.getElementById('replyform').submit();
						              			 
              			 }

              			
				};
				
				if(is_edit==true)
		
					showConfirmDialog(option);
					
				else{
					var area_id = document.getElementById("quete_area").value;
									document.getElementById('replyform').action =ebvpContext+"/sourcing/biddingprojlist/releasepurfilearea?pk_areadivision="+area_id+"&pkProjStep="+strProjStepPk+"&pkProj="+strProjPk;
						 			document.getElementById('replyform').submit();
				
				}
}




//删除澄清答疑页面信息
function delReleaseqa(pk_releaseqa_h){
				//var pk_releaseqa_h = document.getElementById("pk_releaseqa_h").value;
					
	var option={title : "删除提示",

    	content : "您确认要删除该条提问吗？",
        confirm : function() {
	              var pk_release_h = document.getElementById("pk_release_h").value;
				  document.theForm.action = ebvpContext+"/sourcing/biddingprojlist/delReleaseqa?pk_releaseqa_h="+pk_releaseqa_h+"&pk_release_h="+pk_release_h;
				  document.theForm.submit();
				}
              };
				showConfirmDialog(option);
	}
			
			

function setEditPricedata(is_canprice){
		
		$("#pricedatatable").find("input").each(function(){
			$(this).attr("disabled",true);
			// $(this).removeAttr("onkeypress");
//			$(this).attr("readonly","readonly");
			
		});
		
		$("#bidDeliverForm").find("textarea").each(function(){
			$(this).attr("disabled",true);
			 
		});
		$("#bidFileTable").find("a").each(function(){
			$(this).attr("disabled",true);
			 
		});
		
		$("#releaseFile").find("a").each(function(){
			$(this).attr("disabled",true);
			 
		});
		
		var exportdatatemp=$("#exportdata");
		if(exportdatatemp!=null&&"undefined"!=exportdatatemp&&"null"!=exportdatatemp){
		
				$("#exportdata").attr("disabled",true);
		}
		
		var importdatatemp=$("#importdata");
		if(importdatatemp=null&&"undefined"!=importdatatemp&&"null"!=importdatatemp){
		
				$("#importdata").attr("disabled",true);
		}
	
	 
		
		$("#noprodPricedata").find("input").each(function(){
			$(this).attr("disabled",true);
			 
		});
		
		

}
 
 
